home *** CD-ROM | disk | FTP | other *** search
/ Power Bytes: Money & Finance / PowerBytes Money and Finance CD-ROM 01 / PowerBytes Money and Finance CD-ROM 01.iso / Demos / TrueBASIC Demo / Libraries / FntdLib < prev    next >
Encoding:
Text File  |  1985-05-31  |  968 b   |  55 lines  |  [TEXT/TRUE]

  1. !  Library of trigonometric functions (degrees)
  2. !  Copyright (c) 1985 by True BASIC, Inc.
  3.  
  4. EXTERNAL
  5.  
  6. DEF cot(x)
  7.     OPTION ANGLE degrees
  8.     LET cot = 1/tan(x)
  9. END DEF
  10.  
  11. DEF sec(x)
  12.     OPTION ANGLE degrees
  13.     LET sec = 1/cos(x)
  14. END DEF
  15.  
  16. DEF csc(x)
  17.     OPTION ANGLE degrees
  18.     LET csc = 1/sin(x)
  19. END DEF
  20.  
  21. DEF asin(x)
  22.     OPTION ANGLE degrees
  23.     IF abs(x)<1 then
  24.        LET asin = atn(x/sqr(1-x*x))
  25.     ELSEIF x=1 then
  26.        LET asin = 90
  27.     ELSEIF x=-1 then
  28.        LET asin = -90
  29.     ELSE
  30.        CAUSE EXCEPTION -3000, "Argument not in range"
  31.     END IF
  32. END DEF
  33.  
  34. DEF acos(x)
  35.     DECLARE DEF asin
  36.     LET acos = 90 - asin(x)
  37. END DEF
  38.  
  39. DEF acot(x)
  40.     OPTION ANGLE degrees
  41.     LET acot = 90 - atn(x)
  42. END DEF
  43.  
  44. DEF asec(x)
  45.     DECLARE DEF acos
  46.     IF x=0 then CAUSE EXCEPTION -3000, "Argument not in range"
  47.     LET asec = acos(1/x)
  48. END DEF
  49.  
  50. DEF acsc(x)
  51.     DECLARE DEF asin
  52.     IF x=0 then CAUSE EXCEPTION -3000, "Argument not in range"
  53.     LET acsc = asin(1/x)
  54. END DEF
  55.